package com.wc.AlgoOJ_train.train1.c0.A007;

import java.util.Scanner;

/**
 * @Author congege
 * @Description 平方和与立方和
 * http://43.138.190.70:8888/p/A007
 * @Date Created in 2023/12/24-21:31
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int l = sc.nextInt();
            int r = sc.nextInt();
            if (l > r) {
                l = l + r;
                r = l - r;
                l = l - r;
            }
            int odd = 0;
            int even = 0;
            for (int i = l; i <= r; i++) {
                if ((i & 1) == 1) {
                    odd += (int) Math.pow(i, 3);
                } else {
                    even += (int) Math.pow(i, 2);
                }
            }
            System.out.println(even + " " + odd);
        }
    }
}
